#! /bin/sh

# Chris Liner 10Mar2011
# Data has no restrictions

# data.sgy contains 3 traces
segyread tape=./segy/data.sgy | 
segyclean  > data.su

# pull off 3 traces named (a,b,c)
suwind < data.su key=cdp min=2 max=2 > a.su
suwind < data.su key=cdp min=3 max=3 > b.su
suwind < data.su key=cdp min=4 max=4 > c.su

fcat b.su a.su |
supsgraph lineon=1,2 lineoff=0,2 \
  title="TRb (solid) TRa (dash)" \
  x2beg=-1.5 x2end=1.5  > fig1.ps

ps2pdf fig1.ps

# shape a.su to look like b.su
# result is a2b.su and ascii shaping filter 
# is captured in the file shape_a2b.txt
`( sushape < a.su \
  wfile=a.su \
  dfile=b.su \
  showshaper=1 \
  > a2b.su )` > shape_a2b.txt 

fcat a.su b.su a2b.su | suxwigb &

fcat b.su a2b.su | supsgraph lineon=1,2 lineoff=0,2 \
  title="TRb (solid) TRa2b (dash)" \
  x2beg=-1.5 x2end=1.5 \
> fig2.ps
ps2pdf fig2.ps
rm *.ps

# use shaping filter from above to 
# shape c to b using suconv .... not yet
# Problem with above code is that shape_a2b.txt 
# captures a stderr msg "sushape: Shaping filter:"
# how will suconv handle this?  hand edit seems klunky
